package com.s10.ecloud.web.dao.impl;

import javax.annotation.Resource;

import org.hibernate.SessionFactory;
import org.springframework.stereotype.Repository;

import com.s10.ecloud.web.dao.IRoleDAO;
import com.s10.ecloud.web.dao.IUserDAO;
import com.s10.ecloud.web.model.Role;

@Repository
public class RoleDAO implements IRoleDAO {
	@Resource
	private SessionFactory sessionFactory;

	@Override
	public Role getRoleById(int id) {
		Object o = sessionFactory.getCurrentSession().load(Role.class, id);

		if (o != null)

			return (Role) o;
		else
			return null;
	}
}
